<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="生产订单编号">
              <a-input placeholder="请输入生产订单编号" v-model="queryParam.productOrdNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="开始时间">
              <j-date placeholder="请选择开始时间" date-format="YYYY-MM-DD HH:mm:ss" v-model="queryParam.lhcsStartTime"></j-date>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <div>
      <!--详情-->
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="xh"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">详情</a>
        </span>

      </a-table>
    </div>
    <zxjEip_2cLhcs-modal ref="modalForm" @ok="modalFormOk"></zxjEip_2cLhcs-modal>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ZxjEip_2cLhcsModal from './modules/ZxjEip2cLhcsModal'
  import JDate from '@/components/jeecg/JDate.vue'
  export default {
    name: "ZxjEip_2cLhcsList",
    mixins:[JeecgListMixin],
    components: {
      JDate,
      ZxjEip_2cLhcsModal
    },
    data () {
      return {
        description: 'zxj_eip_2c_lhcs管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'生产订单编号',
            align:"center",
            dataIndex: 'productOrdNo'
          },
          {
            title:'装置编号',
            align:"center",
            dataIndex: 'unitNo'
          },
          {
            title:'开始时间',
            align:"center",
            dataIndex: 'lhcsStartTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,20):text)
            }
          },
          {
            title:'结束时间',
            align:"center",
            dataIndex: 'lhcsEndTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,20):text)
            }
          },
          {
            title:'高温老化温度',
            align:"center",
            dataIndex: 'lhcsLhwd'
          },
          {
            title:'抓取状态',
            align:"center",
            dataIndex: 'ioflag',
            customRender:function (text) {
              return !text?"":(text == 0?'已抓取':'未抓取')
            }
          },
          {
            title:'抓取时间',
            align:"center",
            dataIndex: 'updateTime'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/apis/zxjEip2cLhcs/list",
        },
        dictOptions:{
        } 
      }
    },
    methods: {
      initDictConfig(){
      },
      handleDetail(record) {
        this.$refs.modalForm.addModal(record);
        this.$refs.modalForm.title = "老化测试详细信息";
      }
       
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>